
<!--侧边栏-->
  <aside class="sidebar">
    <div class="fixed">
      <div class="widget widget-tabs">
        <ul class="nav nav-tabs" role="tablist">
          <li role="presentation" class="active"><a href="#centre" aria-controls="centre" role="tab" data-toggle="tab">会员中心</a></li>
          <li role="presentation"><a href="#contact" aria-controls="contact" role="tab" data-toggle="tab">联系站长</a></li>
        </ul>

        <div class="tab-content">
          <div role="tabpanel" class="tab-pane centre active" id="centre">
              {% if request.user.is_authenticated %}
              <p>欢迎你： {{ request.user.username }}</p>
              <li>1、在这里你可以发表心情文章</li>
              <li>2、在这里你可以交到新朋友</li>
              <li>3、在这里你可以联系我</li>
              <p>  <a href="/admin" class="btn btn-primary">后台管理</a> <a  href="/accounts/logout/" class="btn btn-primary">退出登录</a></p>

              {% else %}
            <h4>需要登录才能进入会员中心</h4>
            <p> <a data-toggle="modal" data-target="#loginModal" class="btn btn-primary">立即登录</a>
              <a href="/accounts/signup/" class="btn btn-default">现在注册</a>
            </p>
              {% endif %}
          </div>
          <div role="tabpanel" class="tab-pane contact" id="contact">
            <h2>Email:<br />
              <a href="1763499913@qq.com" data-toggle="tooltip" data-placement="bottom" title="1763499913@qq.com">1763499913@qq.com</a>
            </h2>
          </div>
        </div>

      </div>
      <div class="widget widget_search">
        <form class="navbar-form" action="/search/" method="post">
          {% csrf_token %}
          <div class="input-group">
            <input type="text" name="keyword" class="form-control" size="35" placeholder="请输入关键字" maxlength="15" autocomplete="off">
            <span class="input-group-btn">
            <button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
            </span> </div>
        </form>
      </div>
    </div>
    <div class="widget widget_sentence">
      <h3>每日一句</h3>
      <div class="widget-sentence-content">
          <script>
          setInterval("cg.innerHTML=new Date().toLocaleString()",1000);
        var date = new Date()<!--获得日期数据-->
        var y = date.getFullYear();<!--年-->
        var m = date.getMonth()+1;<!--月，这里的月份必须要+1才是当前月份-->
        var d = date.getDate(); <!--日，getDay是获得当前星期几（0-6），getDate是获得当前日期-->
<!--        document.getElementById("ymd").innerHTML = "更新时间："+y+"-"+m+"-"+d;-->
    </script>

        <h4><span id="cg">2019/12/10</span></h4>
        <p>
            {%  for i in mr_yj%}
        {{i.yiju}}
        {% endfor %}</p>
      </div>
    </div>

  <!--  热门文章排行-->
    <div class="widget widget_sentence">
      <h3>热门文章排行</h3>
      <div class="widget-sentence-content">
       {% for h in hot %}
          <ul class="list-group">
            <li class="list-group-item">
              <span class="badge" style="background-color:#FF5151"/>热度{{h.views}}</span>
                <a href="/read/?id={{ h.id }}">{{h.title}}</a>
            </li>
          </ul>
        {% endfor %}
      </div>
    </div>


    <!--  点赞文章排行-->
    <div class="widget widget_sentence">
      <h3>点赞文章排行</h3>
      <div class="widget-sentence-content">
       {% for h in dz_wz %}
          <ul class="list-group">
            <li class="list-group-item">
              <span class="badge" style="background-color:#99cc66"/>点赞数{{h.dz}}</span>
                <a href="/read/?id={{ h.id }}">{{h.title}}</a>
            </li>
          </ul>
        {% endfor %}
      </div>
    </div>

     <!--  文章归档-->
    <div class="widget widget_sentence">
      <h3>文章归档</h3>
      <div class="widget-sentence-content">
                            {% for h in wz_gd %}
                       		 <ul class="list-group">
                                  <li class="list-group-item">
                                        <span class="badge" /> 共{{h.sl}}篇</span>
                                     <a href="/wz_gdlb/?rq={{h.sj}}">{{h.sj}}  </a>
                                  </li>
                                </ul>
                             {% endfor %}
                        </div>
    </div>

    <!--  友情链接-->
    <div class="widget widget_sentence">
      <h3>友情链接</h3>
      <div class="widget-sentence-content">
        {% for y in yq_link %}
         <ul class="list-group">
              <li class="list-group-item">
                 <span class="badge" /> {{y.linkurl}}</span>
                 <a href=" {{ y.linkurl }}">{{y.name}}</a>
              </li>
            </ul>
         {% endfor %}
      </div>
    </div>
  </aside>